<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC 	"-//W3C//DTD XHTML 1.0 Transitional//EN"
						"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	
						<html 	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core">
	<f:view locale="#{facesContext.externalContext.request.locale}">
	<f:loadBundle basename="texte.Info" var="vhtexte" />
	<f:loadBundle basename="texte.Fehler" var="fehlerdetail" />
	<f:event type="javax.faces.event.PreRenderComponentEvent" listener="#{TourneyManager.preInit}" />
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title><h:outputText value="#{vhtexte.turniereTitel}"/></title>
	</h:head>
	<h:body>
	<h:outputStylesheet name="fonts.css"/>
	<p>
	<!-- Navigation -->
	<h:outputText value="Navigation" styleClass='headline' /><br />
	<b><h:outputText value="[>> #{vhtexte.turniereTitel}"/> | 
	<h:outputLink value="login.xhtml"><f:param name="action" value="logout" /><h:outputText value="[>> #{vhtexte.logout}"/></h:outputLink>
	</b>
	<br /><br />
	
	<h:outputText value="#{vhtexte.tournamentOverview}" styleClass='headline'/><br /><br />
	 <b><h:outputText value="#{vhtexte.hello}"/>, <h:outputText value="#{TourneyManager.username}"/></b><br /><br />
	 
	 <!-- Alle bereits beendeten Turniere anzeigen, zu denen der User registriert war -->
		<h:outputText value="#{vhtexte.recentRegisteredTourneys}" styleClass='subhead' />:<br />
		<h:dataTable id="table" 
			 value="#{TourneyManager.recentRegTourneys}" var="tourney" rendered="#{TourneyManager.numRecentRegTourneys > 0}"
			 cellspacing = "2" cellpadding = "2">  
			
			  <h:column>
				<f:facet name="header" >
				  <h:outputText  value="name" styleClass="subhead" />
				</f:facet>
				 <h:outputLink
					 value="tourney_info.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					  <h:outputText value="#{tourney.name}"/>
				</h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.maxPlayers}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.maxPlayers}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.regPlayers}" styleClass="subhead" />
				</f:facet>
				<h:outputLink
					 value="playerList.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					<h:outputText value="#{tourney.registeredPlayers}"/>
				 </h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.game}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.game}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.start}" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.start}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="Status" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.status == 'SIGNUP' ? vhtexte.statusSignUp : tourney.status == 'SIGNIN' ? vhtexte.statusSignIn : tourney.status == 'RUNNING' ? vhtexte.statusRunning : vhtexte.statusFinished}" style="color: #{tourney.statusColor}"/>
			  </h:column>
		</h:dataTable> 
		<p><h:outputText value="#{vhtexte.noRecentRegTourneys}" rendered="#{TourneyManager.numRecentRegTourneys == 0}"/></p>
		<br />
		
		<!-- Alle kommenden und laufenden Turniere anzeigen, zu denen der User angemeldet ist -->
		<h:outputText value="#{vhtexte.upcomingRegisteredTourneys}" styleClass='subhead' />:<br />
		<h:dataTable id="table" 
			 value="#{TourneyManager.upcomingRegTourneys}" var="tourney" rendered="#{TourneyManager.numUpcomingRegTourneys > 0}"
			 cellspacing = "2" cellpadding = "2">  
			
			  <h:column>
				<f:facet name="header" >
				  <h:outputText  value="name" styleClass="subhead" />
				</f:facet>
				 <h:outputLink
					 value="tourney_info.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					  <h:outputText value="#{tourney.name}"/>
				</h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.maxPlayers}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.maxPlayers}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.regPlayers}" styleClass="subhead" />
				</f:facet>
				<h:outputLink
					 value="playerList.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					<h:outputText value="#{tourney.registeredPlayers}"/>
				 </h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.game}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.game}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.start}" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.start}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="Status" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.status == 'SIGNUP' ? vhtexte.statusSignUp : tourney.status == 'SIGNIN' ? vhtexte.statusSignIn : tourney.status == 'RUNNING' ? vhtexte.statusRunning : vhtexte.statusFinished}" style="color: #{tourney.statusColor}"/>
			  </h:column>
		</h:dataTable> 
		<p><h:outputText value="#{vhtexte.noUpcomingRegTourneys}" rendered="#{TourneyManager.numUpcomingRegTourneys == 0}"/></p>
		<br />
		
		<!-- Alle beendeten Turniere anzeigen -->
		<h:outputText value="#{vhtexte.allRecentTourneys}" styleClass='subhead'/>:<br />
		<h:dataTable id="table" 
			 value="#{TourneyManager.recentTourneys}" var="tourney" rendered="#{TourneyManager.numRecentTourneys > 0}"
			 cellspacing = "2" cellpadding = "2">  
			
			  <h:column>
				<f:facet name="header" >
				  <h:outputText  value="name" styleClass="subhead" />
				</f:facet>
				 <h:outputLink
					 value="tourney_info.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					  <h:outputText value="#{tourney.name}"/>
				</h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.maxPlayers}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.maxPlayers}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
					<h:outputText  value="#{vhtexte.regPlayers}" styleClass="subhead" />
				</f:facet>
				<h:outputLink
					 value="playerList.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					<h:outputText value="#{tourney.registeredPlayers}"/>
				 </h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.game}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.game}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.start}" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.start}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="Status" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.status == 'SIGNUP' ? vhtexte.statusSignUp : tourney.status == 'SIGNIN' ? vhtexte.statusSignIn : tourney.status == 'RUNNING' ? vhtexte.statusRunning : vhtexte.statusFinished}" style="color: #{tourney.statusColor}"/>
			  </h:column>
		</h:dataTable> 
		<p><h:outputText value="#{vhtexte.noRecentTourneys}" rendered="#{TourneyManager.numRecentTourneys == 0}"/></p>
		<br />
		
		<!-- Alle kommenden und laufenden Turniere anzeigen -->
		<h:outputText value="#{vhtexte.allUpcomingTourneys}" styleClass='subhead'/>:<br />
		<h:dataTable id="table" 
			 value="#{TourneyManager.upcomingTourneys}" var="tourney" rendered="#{TourneyManager.numUpcomingTourneys > 0}"
			 cellspacing = "2" cellpadding = "2">  
			
			  <h:column>
				<f:facet name="header" >
				  <h:outputText  value="name" styleClass="subhead" />
				</f:facet>
				 <h:outputLink
					 value="tourney_info.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					  <h:outputText value="#{tourney.name}"/>
				</h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.maxPlayers}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.maxPlayers}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
					<h:outputText  value="#{vhtexte.regPlayers}" styleClass="subhead" />
				</f:facet>
				<h:outputLink
					 value="playerList.xhtml">
					  <f:param name="tourneyID" value="#{tourney.ID}" />
					<h:outputText value="#{tourney.registeredPlayers}"/>
				 </h:outputLink>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.game}" styleClass="subhead" />
				</f:facet>
				 <h:outputText value="#{tourney.game}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="#{vhtexte.start}" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.start}"/>
			  </h:column>
			  <h:column>
				<f:facet name="header">
				  <h:outputText  value="Status" styleClass="subhead"/>
				</f:facet>
				 <h:outputText value="#{tourney.status == 'SIGNUP' ? vhtexte.statusSignUp : tourney.status == 'SIGNIN' ? vhtexte.statusSignIn : tourney.status == 'RUNNING' ? vhtexte.statusRunning : vhtexte.statusFinished}" style="color: #{tourney.statusColor}"/>
			  </h:column>
		</h:dataTable> 
		<p><h:outputText value="#{vhtexte.noUpcomingTourneys}" rendered="#{TourneyManager.numUpcomingTourneys == 0}"/></p>
		<p>
		<br />
		<p>
		<h:outputText value="#{vhtexte.adminFunktion}" rendered="#{TourneyManager.admin}" styleClass="subhead" /><br />
		<b>- <h:outputLink value="addTournament.xhtml">
			<h:outputText value="#{vhtexte.addTournamentTitel}" rendered="#{TourneyManager.admin}"/>
		</h:outputLink></b>

		</p>
		</p>
		</p>
	</h:body>
	</f:view>
</html>
